{% extends "opda/base.html" %}

{% block mid %}
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-body">
                {% if current_user.super_user %}
                <button class="pull-right btn btn-primary" data-toggle="modal" data-target="#add_box_dialog">添加盒子</button>
                {% endif %}
                {% if boxs|length %}
                    请点击选择要管理的盒子：<br/>
                    <table class="table table-bordered table-striped table-hover" style="background-color: aliceblue;">
                    <thead>
                        <tr>
                            <th>mac地址<img src="/static/img/computer.png"></th>
                            <th>info<img src="/static/img/info.png"></th>
                            <th>管理<img src="/static/img/management.png"></th>
                            <th>上线时间<img src="/static/img/time.png"></th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for b in boxs %}
                            <tr>
                                <td>{{ b.mac }}</td>
                                <td>{{ b.info }}</td>
                                <td><a href="/boxinfo/{{ b.id }}" >管理</a>&nbsp;&nbsp;<a href="/boxdev/{{ b.id }}" >查看</a></td>
                                <td>--:--</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                    </table>

                {% else %}
                    没有管理的盒子
                {% endif %}
            </div>

        </div>
    </div>

    {% include 'opda/block/dialog.html' %}
{% endblock %}